import { Scene_Base } from "@/scenes/Scene_Base.js";
import { SceneManager } from "@/managers/SceneManager.js";
import { Window_Help } from "@/windows/Window_Help.js";
import { config } from "@/managers/ConfigManager.js";
import { Sprite } from "@/sprites/Sprite.js";

export class Scene_MenuBase extends Scene_Base {
    constructor() {
        super();
    }

    create() {
        super.create();
        this.createBackground();
        this.updateActor();
    }

    actor() {
        return this._actor;
    }

    updateActor() {
        this._actor = $gameParty.menuActor();
    }

    createBackground() {
        this._backgroundSprite = new Sprite(SceneManager.backgroundBitmap());
        this.addChild(this._backgroundSprite);
    }

    setBackgroundOpacity(opacity) {
        this._backgroundSprite.opacity = opacity;
    }

    createHelpWindow() {
        this._helpWindow = new Window_Help(config.width,72);
        this.addWindow(this._helpWindow);
    }

    nextActor() {
        $gameParty.makeMenuActorNext();
        this.updateActor();
        this.onActorChange();
    }

    previousActor() {
        $gameParty.makeMenuActorPrevious();
        this.updateActor();
        this.onActorChange();
    }

    onActorChange() {
    }
}